var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/businessComponent/Attachment/components/Toolbar.tsx
var Toolbar_exports = {};
__export(Toolbar_exports, {
  Toolbar: () => Toolbar
});
module.exports = __toCommonJS(Toolbar_exports);
var import_icons = require("@ant-design/icons");
var import_antd = require("antd");
var import_components = require("../components");
function Toolbar(props) {
  const { permission, uploadRef, uploading, isReady, onToolbarClick, ...rest } = props;
  return /* @__PURE__ */ React.createElement(import_antd.Space, { size: [15, 10], wrap: true }, (permission == null ? void 0 : permission.add) === 2 ? null : /* @__PURE__ */ React.createElement(import_components.Upload, { ...rest, ref: uploadRef }, /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      permissionStatus: permission == null ? void 0 : permission.add,
      disabled: !isReady || uploading,
      icon: /* @__PURE__ */ React.createElement(import_icons.FileAddOutlined, null)
    },
    /* @__PURE__ */ React.createElement("span", null, "新增")
  )), /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      permissionStatus: permission == null ? void 0 : permission.delete,
      icon: /* @__PURE__ */ React.createElement(import_icons.FileExcelOutlined, null),
      onClick: () => onToolbarClick("delete")
    },
    "删除"
  ), /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      permissionStatus: permission == null ? void 0 : permission.download,
      icon: /* @__PURE__ */ React.createElement(import_icons.DownloadOutlined, null),
      onClick: () => onToolbarClick("download")
    },
    "下载"
  ), /* @__PURE__ */ React.createElement(
    import_components.AttachmentButton,
    {
      permissionStatus: permission == null ? void 0 : permission.zipDownload,
      icon: /* @__PURE__ */ React.createElement(import_icons.DownloadOutlined, null),
      onClick: () => onToolbarClick("zipDownload")
    },
    "打包下载"
  ));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Toolbar
});
